package com.mysoft.service.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mysoft.common.entity.Role;
import com.mysoft.common.entity.User;
import com.mysoft.dao.dao.UserMapper;
import com.mysoft.service.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: JohnCoding
 * @Description:
 * @date: 2019/12/23 9:48
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Override
    public User getByUserName(String username) {
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.eq("username", username);
        wrapper.last("limit 1");
        return baseMapper.selectOne(wrapper);
    }
}
